#coding:utf-8
from django.db import models
from lovewith.share.models import Attachment
from lovewith.account.models import MtUser



#灵感板
class Album(models.Model):
    name = models.CharField(max_length=255, verbose_name=u'灵感板')
    user = models.ForeignKey(MtUser, verbose_name=u'用户')

    def __unicode__(self):
        return self.name

    class Meta:
        verbose_name = u'灵感板'
        db_table = 'mt_user_album'


#灵感板图片
class AlbumAttach(models.Model):
    post_image = models.ForeignKey(Attachment, verbose_name=u'图片')
    album = models.ForeignKey(Album, verbose_name=u'灵感板')
    user = models.ForeignKey(MtUser, verbose_name=u'用户')

    def __unicode__(self):
        return self.user.username

    class Meta:
        verbose_name = u'灵感板图片'
        db_table = 'mt_user_album_attach'